# Copyright 1999-2002 Gentoo Technologies, Inc.
# Distributed under the terms of the GNU General Public License v2
# $Header: /home/cvsroot/gentoo-x86/net-httpd/thttpd/thttpd-2.21b.ebuild,v 0.1 2002/12/09 04:33:16 manson Exp $

IUSE="php"

DESCRIPTION="Tiny/trottle http server"
HOMEPAGE="http://www.acme.com"

S=${WORKDIR}/thttpd-${PV}
SRC_URI="http://www.acme.com/software/thttpd/${PN}-${PV}.tar.gz"

DEPEND=""
RDEPEND=""
LICENSE="GPL-2"
SLOT="0"
KEYWORDS="x86 "

[ -z "$HTTPD_ROOT" ] && HTTPD_ROOT=/home/httpd

src_unpack() {
	unpack ${PN}-${PV}.tar.gz
}

src_compile() {
	local myconf

	./configure \
	--prefix=/usr \
	--mandir=/usr/share/man \
	--infodir=/usr/share/info \
	--host=${CHOST} ${myconf} || die "bad configure"

	make CCOPT="${CFLAGS}" || die
}

src_install() {
	dodir ${HTTPD_ROOT}
	chmod 755 ${HTTPD_ROOT}
	chown -R nobody ${HTTPD_ROOT}

	dobin thttpd
	doman thttpd.8

	exeinto /etc/init.d ; newexe ${FILESDIR}/thttpd.rc6 thttpd
	insinto /etc ; newins ${FILESDIR}/thttpd.conf thttpd.conf.sample
}
